package cl.tieba.core;

import io.dropwizard.auth.AuthenticationException;
import io.dropwizard.auth.Authenticator;
import io.dropwizard.auth.basic.BasicCredentials;

import com.google.common.base.Optional;

public class TiebaAuthenticator implements
		Authenticator<BasicCredentials, Boolean> {

	@Override
	public Optional<Boolean> authenticate(BasicCredentials c)
			throws AuthenticationException {
		if ("free".equals(c.getUsername()) && "free".equals(c.getPassword())) {
			return Optional.of(true);
		} else {
			return Optional.absent();
		}
	}
}
